package com.fulin.datastract.bitMap;

import java.util.Arrays;
import java.util.BitSet;

/**
*
* @description 
* @auther fulin16@crnet.com.hk
* @since 2020年7月8日 上午10:00:03
*
*/
public class JDKBitSet {
	public static void main(String[] args) {
		BitSet bitSet = new BitSet();
		bitSet.set(0);
		bitSet.set(1);
		bitSet.set(63);
		bitSet.set(62);
		bitSet.set(65);
		bitSet.set(66);
		
		System.out.println(bitSet.toString());
		System.out.println(Arrays.toString(bitSet.toLongArray()));
		System.out.println(Arrays.toString(bitSet.toByteArray()));
		System.out.println(bitSet.size());
		System.out.println(bitSet.cardinality());
		
		String s = Long.toBinaryString(bitSet.toLongArray()[0]);
		System.out.println(s);
	}
}
